const { exec } = require('child_process');
const path = require('path');

// 获取 dist 目录的绝对路径
const distPath = path.join(__dirname, 'dist');

// 启动 http-server
const server = exec(`http-server "${distPath}" -o`, (error) => {
  if (error) {
    console.error(`执行错误: ${error}`);
    return;
  }
});

console.log('正在启动服务器...');
server.stdout.on('data', (data) => {
  console.log(data);
}); 